{include file="public/header" /}
</head>
<body>
    <div id="main-container">
        {include file="public/menu" /}
        <div class="main">
            <div class="notice">{$position.url}</div>
            <div class="main_content">
                <div class="title">
                    <span>{$position.name}</span>
                </div>
                <a class="btn do-action" data-type="doDelete" data-href="{:url('dellog')}">删除</a>
				<div class="table">
					<table class="layuitable">
						<thead>
							<tr>
								<th width="50"><input type="checkbox" class="selected-all" id="selected-all"></th>
								<th width="50"><span>ID</span></th>
								<th width="100"><span>用户ID</span></th>
								<th width="100"><span>操作用户</span></th>
								<th><span>描述</span></th>
								<th width="100"><span>操作IP</span></th>
								<th><span>地址</span></th>
                                <th width="100"><span>状态</span></th>
                                <th width="150"><span>操作时间</span></th>
                                <th width="80"><span>操作</span></th>
							</tr>
						</thead>
						<script id="arlist" type="text/html">
                            {{# for(var i=0;i<d.length;i++){  }}
                            <tr class="long-td">
                                <td>
                                    <div class="icheckbox_square-green diychk" style="position: relative;"><input type="checkbox" style="position: absolute; opacity: 0;" name="ck" ids="{{d[i].log_id}}" value="true"><ins class="iCheck-helper"></ins></div>  
                                </td>
                                <td>{{d[i].log_id}}</td>
                                <td>{{d[i].admin_id}}</td>
                                <td>{{d[i].admin_name}}</td>
                                <td>{{d[i].description}}</td>
                                <td>{{d[i].ip}}</td>
                                <td>{{d[i].ipaddr.country}}{{d[i].ipaddr.area}}</td>
                                <td>
                                    {{# if(d[i].status==1){ }}
                                        操作成功
                                    {{# }else{ }}
                                        <span style="color: red">操作失败</span>
                                    {{# } }}
                                </td>
                                <td>{{d[i].add_time}}</td>
                                <td>
                                    <a class="btn do-action" data-type="doDelOne" data-href="{:url('dellog')}" data-id="{{d[i].log_id}}">删除</a>
                                </td>
                            </tr>
                            {{# } }}
                        </script>
                        <tbody id="article_list"></tbody>
					</table>
				</div>
                <div id="AjaxPage" style="float: right;margin-top:-10px; "></div>
                <div class="CountPage" style="float: right;clear:both; margin-right:15px; margin-top:-5px;">
                    共 {$count} 条 <span id="allpage"></span>
                </div>
                <div style="clear:both;"></div>
			</div>
		</div>
	</div>
<script>
    var laytpl,laypage;
    var url='{:url("log/index")}';
    var allpages='{$allpage}';
    layui.use(['layer', 'form','laypage','common', 'icheck','laytpl'], function () {
        var $ = layui.jquery, layer = layui.layer, common = layui.common, form = layui.form();
        $form = $('form');
        laytpl =layui.laytpl;
        laypage = layui.laypage;
        
        common.Ajaxpage();

        //加载单选框样式
        $(("[type='checkbox']")).iCheck({
            checkboxClass: 'icheckbox_square-green',
        });

        //全选
        $(document).on('ifChanged','.selected-all', function (event) {
            var $input = $('.layuitable tbody tr td').find('input');
            if ($('.selected-all').attr("checked")) {
                $("#article_list .diychk").addClass('checked');
                $("#article_list .diychk").children('input:checkbox').attr("checked", true);
            }else{
                $("#article_list .diychk").removeClass('checked');
                $("#article_list .diychk").children('input:checkbox').attr("checked", false);
            }
        });
        $(document).on('click','.diychk', function () {
            if ($(this).hasClass('checked')) {
                $(this).removeClass('checked');
                $(this).children('input:checkbox').attr("checked", false);
            }else{
                $(this).addClass('checked');
                $(this).children('input:checkbox').attr("checked", true);
            }
        });

    });

</script>
</body>
</html>